﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebFormTest.aspx.cs" Inherits="map.common.WebFormTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
         <iframe src="UploadFilePage.aspx"  id="UploadFileFrame" name="UploadFileFrame"  width="300px" height="60px" frameborder ="0"></iframe>
         <br />
         <label for="UploadFileUrlInput">上传的文件</label><input id="UploadFileUrlInput" type="text" value=""  />
         <br />
         <input  type="button" id="UploadFileButton" value ="上传" onclick="uploadFile();"/>
         <input  type ="button" id="alertFileButton" value="提示" onclick ="alertFile();"/>
    </div>
    <script type="text/javascript" >
        var frameObj = window.frames["UploadFileFrame"];
        var timeid;
        function uploadFile() {
            frameObj.window.saveFile();
            timeid = setInterval(function() {
                var status = frameObj.window.getUploadFileStatus();
                if (status == "1") {
                    alert(frameObj.window.getHttpFileUrl());
                    clearInterval(timeid);
                    return;
                }
            }, 100); 
        }
        function alertFile() {
            frameObj.window.alertTest();
        }
    </script>
    </form>
</body>
</html>
